// CyTargetLinker,
// a Cytoscape plugin to extend biological networks with regulatory interaction
// Copyright 2011-2012 BiGCaT Bioinformatics
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package cytargetlinker;

import java.util.ArrayList;
import java.util.List;

import cytargetlinker.Preferences.DataSource;
import cytoscape.CyNetwork;

/**
 * data object of the CyTargetLinker plugin
 *
 */
public class CyTargetLinkerObject {
	
	private CyNetwork userNetwork;
	private CyNetwork resultingNetwork;
	private String idAttribute;
	private DataSource dataSource;
	private List<RegulatoryInteractionNetwork> rins;
	
	public CyTargetLinkerObject() {
		rins = new ArrayList<RegulatoryInteractionNetwork>();
	}
	
	public boolean getRIN(RegulatoryInteractionNetwork network) {
		if(network != null && !rins.contains(network)) {
			rins.add(network);
			return true;
		}
		return false;
	}
	
	public RegulatoryInteractionNetwork getRIN(CyNetwork network) {
		for(RegulatoryInteractionNetwork net : rins) {
			if(net.getNetwork() == network) {
				return net;
			}
		}
		return null;
	}

	public CyNetwork getUserNetwork() {
		return userNetwork;
	}

	public void setUserNetwork(CyNetwork userNetwork) {
		this.userNetwork = userNetwork;
	}

	public List<RegulatoryInteractionNetwork> getRINs() {
		return rins;
	}

	public void setRIN(List<RegulatoryInteractionNetwork> targetNetworks) {
		this.rins = targetNetworks;
	}

	public String getIdAttribute() {
		return idAttribute;
	}

	public void setIdAttribute(String idAttribute) {
		this.idAttribute = idAttribute;
	}

	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	public CyNetwork getCreateNetwork() {
		return resultingNetwork;
	}

	public void setCreateNetwork(CyNetwork createNetwork) {
		this.resultingNetwork = createNetwork;
	}
}
